package com.java.main.jvm;

/**
 * @Description
 * @Author 顾志杰
 * @Date 2021/9/28 15:05
 */
public class JVM extends superJVM{

    JVM() {
        System.out.println("构造函数");
    }

    {
        System.out.println("构造函数块");
    }

    static {
        a = 0;
        System.out.println("静态代码块");
    }



    public static void main(String[] args) {
        new JVM();
        System.out.println("main");
        System.out.println(a);
    }
}

class superJVM{
    protected static int a = 1;

    superJVM() {
        System.out.println("父构造函数");
    }

    {
        System.out.println("父构造函数块");
    }

    static {
        System.out.println("父静态代码块");
    }

}